package com.lins.saas.controller;

import com.lins.common.common.enums.OperationType;
import com.lins.common.common.result.Result;
import com.lins.common.mp.controller.BaseController;
import com.lins.saas.common.dto.SysTenantDto;

import com.lins.saas.service.impl.SysTenantServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author Administrator
 * @title: TenantContrller
 * @projectName lins
 * @description:
 * @date 2021/12/17 13:08
 */
@RestController
@RequestMapping("/tenant/")
public class SysTenantController extends BaseController {

    @Autowired
    private SysTenantServiceImpl sysTenantService;

    @PostMapping("add")
    public Result add(@RequestBody SysTenantDto sysTenantDto)
    {
        sysTenantDto.setOperationType(OperationType.ADD);
        return exec("新增租户",sysTenantDto,()->{
            return sysTenantService.crud(sysTenantDto);
        });
    }

}
